Checking object invariants
نویسندگان
چکیده
When writing computer programs, programmers make assumptions about the relations among variables. In object-oriented programs, these assumptions include relations among the instance variables of a single object, relations often referred to as object invariants. It is a good idea to explicitly annotate a program with these assumptions. Then, a static program-analysis tool can inspect the annotated program to check that routines preserve object invariants. This paper considers two issues that affect what object invariants a program analysis tool can check: object construction and modular checking. The paper suggests some programming idioms and program annotations that widen the range of object invariants that a static program checker can check. The paper also suggests a simple extension to the Java programming language that makes the language more amenable to object-
منابع مشابه
Modular verification of global module invariants in object-oriented programs
Modules and objects both contain variables whose values may be constrained by invariants. For example, in the object-oriented languages Java and C#, a module is a class and its static fields, and an object is an instance of a class and its instance variables. The invariants of modules work differently both from the invariants of objects alone and from the invariants of modules in a procedural l...
متن کاملHybrid Types, Invariants, and Refinements For Imperative Objects
To control the complexity of large object-oriented systems, objects should communicate via precisely-specified interfaces. Static type checking catches many interface violations early in the development cycle, but decidability limitations preclude checking all desired properties statically. In contrast, dynamic checking supports expressive specifications but may miss errors on execution paths t...
متن کاملQuantified Heap Invariants for Object-Oriented Programs
Heap and data structures represent one of the biggest challenges when applying model checking to the analysis of software programs: in order to verify (unbounded) safety of a program, it is typically necessary to formulate quantified inductive invariants that state properties about an unbounded number of heap locations. Methods like Craig interpolation, which are commonly used to infer invarian...
متن کاملUsing Reflection to Implement in Maude a Rewriting-Based Validation Tool for UML+OCL Static Class Diagrams
In this paper we present the ITP/OCL tool, a rewritingbased tool that supports automatic validation of UML static class diagrams with respect to OCL invariants. From a conceptual point of view, the ITP/OCL tool is directly based on the equational specification of UML+OCL class diagrams developed in [11], according to which: i) class and object diagrams are specified as membership equational the...
متن کاملApplying Formal Semantics of an Object-oriented Language to Program Invariant Checking
We consider a specific kind of Abstract State Machines. It is shown how the machines can be used to provide a low-level formal semantics for a tiny object-oriented language, including control flow operators, object creation and field manipulation. Then the decidability result is established for checking invariants of programs corresponding to that class of ASMs.
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1997